Tools and Methods for Analysis, Debugging, and Performance Improvement of Equation-Based Models
نویسنده
چکیده
Equation-based object-oriented (EOO) modeling languages such as Modelica provide a convenient, declarative method for describing models of cyber-physical systems. Because of the ease of use of EOO languages, large and complex models can be built with limited effort. However, current state-of-the-art tools do not provide the user with enough information when errors appear or simulation results are wrong. It is of paramount importance that such tools should give the user enough information to correct errors or understand where the problems that lead to wrong simulation results are located. However, understanding the model translation process of an EOO compiler is a daunting task that not only requires knowledge of the numerical algorithms that the tool executes during simulation, but also the complex symbolic transformations being performed. As part of this work, methods have been developed and explored where the EOO tool, an enhanced Modelica compiler, records the transformations during the translation process in order to provide better diagnostics, explanations, and analysis. This information is used to generate better error-messages during translation. It is also used to provide better debugging for a simulation that produces unexpected results or where numerical methods fail. Meeting deadlines is particularly important for real-time applications. It is usually essential to identify possible bottlenecks and either simplify the model or give hints to the compiler that enable it to generate faster code. When profiling and measuring execution times of parts of the model the recorded information can also be used to find out why a particular system model executes slowly. Combined with debugging information, it is possible to find out why this system of equations is slow to solve, which helps understanding what can be done to simplify the model. A tool with a graphical user interface has been developed to make debugging and performance profiling easier. Both debugging and profiling have been combined into a single view so that performance metrics are mapped to equations, which are mapped to debugging information. The algorithmic part of Modelica was extended with meta-modeling constructs (MetaModelica) for language modeling. In this context a quite general approach to debugging and compilation from (extended) Modelica to C code was developed. That makes it possible to use the same executable format for simulation executables as for compiler bootstrapping when the compiler written in MetaModelica compiles itself. Finally, a method and tool prototype suitable for speeding up simulations has been developed. It works by partitioning the model at appropriate places and compiling a simulation executable for a suitable parallel platform. Populärvetenskaplig sammanfattning Som ingenjör lär man sig att först̊a världen genom ekvationer. För att beskriva eller modellera ett fysikaliskt system, till exempel vid utveckling av en produkt, vill ingenjören använda sig av de ekvationer som han eller hon lärt sig fr̊an böcker eller föreläsningar. Vid produktutveckling kan ett av m̊alen med modellen vara att hitta de bästa parametrarna för att f̊a den snabbaste, mest h̊allfasta eller billigaste lösningen. Man vill s̊aledes använda en dator för att göra en simulering av modellen, men de instruktioner en dator tar körs i sekvens och gör i grund och botten bara en massa beräkningar och tilldelningar till olika minnespositioner. De klassiska programmeringsparadigmerna, exempelvis imperativ programmering, fungerar p̊a liknande sätt – man skriver en algoritm som körs p̊a uppifr̊an och ner. Den här avhandlingen fokuserar p̊a ekvationsbaserade programmeringsspr̊ak. I ekvationsbaserade programmeringsspr̊ak, till exempel Modelica, översätts ekvationer till imperativ kod, som lätt kan översättas till maskinkod. Detta gör allts̊a att en ingenjör som är duktig p̊a modellering och ekvationer kan simulera sina modeller p̊a ett effektivt sätt utan att vara datavetare och ha en djup kunskap om programmering. Problemet är att man vid översättning fr̊an ekvationer till maskinkod tappar en massa användbar information. Om ett fel inträffar vid simulering av modellen s̊a vill man f̊a reda p̊a var felet kommer ifr̊an. Tidigare har detta varit inte varit möjligt, men i avhandlingen introduceras en metod som sparar tillräckligt med information för att visa vilken ekvation felet inträffade i och alla de symboliska operationer som utförts p̊a ekvationen. Informationen kan sedan visas i en grafisk debugger. För att kunna simulera i realtid, till exempel en körsimulator där en människa kör en simulerad bil, s̊a m̊aste datorn kunna lösa ekvationer runt 100 g̊anger i sekunden för att illusionen av att det är en simulering inte ska förstöras. Om ett ekvationssystem är alldeles för detaljerat s̊a tar det för l̊ang tid att köra det. I avhandlingen kombineras möjligheten att mäta körtid av ekvationer med den grafiska debuggern. D̊a ser man inte enbart vilka ekvationer som tar l̊ang tid att köra, utan även varför de tar l̊ang tid att köra. Ekvationerna kan sedan förenklas för att kunna köra simuleringen i realtid.
منابع مشابه
Industrial Evaluation of Integrated Performance Analysis and Equation Model Debugging for Equation-Based Models
The ease of use and the high abstraction level of equation-based object-oriented (EOO) languages such as Modelica has the drawback that performance problems and modeling errors are often hard to nd. To address this problem, we have earlier developed advanced performance analysis and equation model debugging support in the OpenModelica tool. The aim of the work reported in this paper is to perfo...
متن کاملTools for Understanding, Debugging, and Simulation Performance Improvement of Equation-Based Models
Equation-based object-oriented (EOO) modelling languages provide a convenient, declarative method for describing models of cyber-physical systems. Because of the ease of use of EOO languages, large and complex models can be built with limited effort. However, current state-of-the-art tools do not provide the user with enough information when errors appear or simulation results are wrong. It is ...
متن کاملData envelopment analysis in service quality evaluation: an empirical study
Service quality is often conceptualized as the comparison between service expectations and the actual performance perceptions. It enhances customer satisfaction, decreases customer defection, and promotes customer loyalty. Substantial literature has examined the concept of service quality, its dimensions, and measurement methods. We introduce the perceived service quality index (PSQI) as a sing...
متن کاملA Hybrid 3D Colon Segmentation Method Using Modified Geometric Deformable Models
Introduction: Nowadays virtual colonoscopy has become a reliable and efficient method of detecting primary stages of colon cancer such as polyp detection. One of the most important and crucial stages of virtual colonoscopy is colon segmentation because an incorrect segmentation may lead to a misdiagnosis. Materials and Methods: In this work, a hybrid method based on Geometric Deformable Models...
متن کاملGenome-Scale Metabolic Network Models of Bacillus Species Suggest that Model Improvement is Necessary for Biotechnological Applications
Background: A genome-scale metabolic network model (GEM) is a mathematical representation of an organism’s metabolism. Today, GEMs are popular tools for computationally simulating the biotechnological processes and for predicting biochemical properties of (engineered) strains.Objectives: In the present study, we have evaluated the predictive power of two ...
متن کاملComparison of Bayesian and Frequentist Methods in Estimating the Net Reclassification and Integrated Discrimination Improvement Indices for Evaluation of Prediction Models: Tehran Lipid and Glucose Study
Introduction: The Frequency-based method is commonly used to estimate the Net Reclassification Improvement (NRI)- and Integrated Discrimination Improvement (IDI) indices. These indices measure the magnitude of the performance of statistical models when a new biomarker is added. This method has poor performance in some cases, especially in small samples. In this study, the performance of two Bay...
متن کامل